Repository navigation
fix(shell): 补齐候选事件分派,并让 candidate-tui 在缺少 Vim 时快速失败 - #269
Merged
Merged
Conversation
#267 在 CI 上补上固定 Vim 后,candidate-tui 改用真实 Vim 运行,随即撞到下一条: stage=50 … screen 中 [New] 与 READY 都已就位 unsupported terminal event kind 该串只在 shell.cpp:826 抛出。对照 ffi.rs:326-342 的完整映射,候选适配器会发出 1-13 全部 13 种事件,而本处只处理 1,2,3,4,5,6,7,12,于是 8(ClipboardStore)、 9(ClipboardLoad)、10(ColorRequest)、11(TextAreaSizeRequest)、13(ChildExit) 任何一种都会让整个场景中止。 本修改补齐 8/9/13,并把 10/11 一并列为忽略:该 harness 比较的是文字、模式与 生命周期,不拥有剪贴板,退出码从 session 读取,这些通知对它没有语义。default 分支保留,未来新增 kind 仍会明确失败而不是被静默吞掉。 验证:本机装上与 CI 同源的 Vim 9.1(Git for Windows usr/bin)后, candidate_shell_tui 与 candidate_core 均通过;1-13 现已全部有分支覆盖。
JavaZeroo
added a commit
that referenced
this pull request
Oct 31, 2026
#269 的 CI 结果是决定性的:该 PR 不含本步骤,两个 alacritty Windows 作业仍然 5m50s / 6m05s 通过。也就是说 hosted runner 上 Vim 本来就在 PATH,真正的失败 一直是 route_terminal_events 对 kind 8/9/10/11/13 抛异常,而不是缺 Vim。 本步骤因此没有依据,还引入一个新失败面(Git 安装位置变化时 exit 1)。 保留 run.py 的前置检查:它只在本地没有 Vim 时把 33 秒场景超时换成一条带文档 指引的即时失败,对 CI 无副作用。
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题与最终行为
alacritty-headless (windows-2025)反复在candidate_shell_tui失败。用 GitHub 的 job API 取每步结论(无需日志)定位到「Build and test candidate shell on Windows」,再用该 run 的 artifact 读到现场:Vim 正常启动、
[New]与READY都已就位,场景却因为一个未处理的事件类型中止。根因:事件分派不完整
unsupported terminal event kind只在experiments/shell/shell.cpp:826抛出。对照experiments/candidates/alacritty/src/ffi.rs:326-342,适配器会发出全部 13 种事件,而 shell 只处理 7 种:default: throw保留——将来适配器新增 kind 仍会明确失败,而不是被静默吞掉。忽略 8/9/10/11/13 的依据:该 harness 比较文字、模式与生命周期;它不拥有剪贴板,退出码从 session 读取,这些通知对它没有语义。
附带:缺少 Vim 时快速失败
candidate-tui会在真实 shell 里键入 Vim 命令。缺少 Vim 时原先要跑满 33 秒场景超时才失败,唯一痕迹是 shell 回显的not recognized。本 PR 在run.py的execute()入口加一次前置检查,缺失立即抛RuntimeError并指向docs/research/joint-conpty-baseline.md。按more-capture-ech.md「skip 不代替运行证据」,这里是失败而不是 skip。(原 #267 的 workflow PATH 步骤已被证伪并移除:本 PR 不含它时两个 Windows 作业仍以 5m50s / 6m05s 通过。)验证
alacritty-headless (windows-2025)两个作业均通过(5m50s / 6m05s),这是修复前后的直接对照case分支覆盖 kind 1–13 全部取值,与ffi.rs映射一一对应candidate_core1.66s、candidate_shell_tui9.30s 通过;默认配置 67/67 通过RuntimeError;非candidate-tui模式不受影响性能影响(如适用)
不适用。仅增加事件分支与一次 PATH 查找。
来源与限制
sample.json(stderr与screen)与该轮candidate-startup-log.txtcandidate-tui的任何断言